<?php
session_start();
?>


<?php
$username = $_SESSION['username'];
if($username==null || $username== ""|| $username == "")
{
	header('Location: http://172.26.195.159/checklist/php/logout.php');
}
?>

<html>
<head>
<title>
Change Password
</title>

<script type="text/javascript">

function validate()
{
var old_password = document.getElementById("old_password").value;
var new_password = document.getElementById("new_password").value;
var confirm_password = document.getElementById("confirm_password").value;


if(old_password == "" || old_password == " " || old_password == null)
{
alert("Please enter the old password to proceed");
return false;
}

if(new_password == "" || new_password == " ")
{
alert("Please enter the new password to proceed");
return false;
}

if(confirm_password == "" || confirm_password == " ")
{
alert("Please enter the confirm password to proceed");
return false;
}

if(confirm_password != new_password)
{
alert("New and confirm passwords dont match");
return false;
}
return true;
}

</script>
<!-- Change Password -->

</head>

<body bgcolor="#C9C299">


<form name="changepassword" action="processChangePassword.php" method="POST" onsubmit="return validate()">

<a href="welcome.php">Go Back</a>
<center>
</br></br>
<b>Your Old Password : </b>
<input type="password" name="old_password" id="old_password"/>
</br>
<b>Enter new Password : </b>
<input type="password" name="new_password" id="new_password"/>
</br>
<b>Confirm Password : </b>
<input type="password" name="confirm_password" id="confirm_password"/>
</br></br></br>
<input type="submit" name="submit" value="Change Password" onclick="return validate()"/>

</center>
</form>
</body>

</html>